﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ScreenManage
{
    public static class ScreenHelper
    {
        private static IScreenHelper screen = null;

        private static int CheckSystem()
        {
            OperatingSystem op = Environment.OSVersion;
            if (op.Version.Major < 6)
            {
                return 1;
            }
            else if (op.Version.Major >= 6)
            {
                return 2;
            }
            else
            {
                return 0;
            }
        }

        public static IScreenHelper CreateScreenHelper()
        {
            switch (CheckSystem())
            {
                case 0:
                    break;
                case 1:
                    screen = new ScreenHelperOfXp();
                    break;
                case 2:
                    screen = new ScreenHelperOfWin7();
                    break;
            }
            return screen;
        }
    }
}
